import Vue from 'vue'
import Router from 'vue-router'
import Register from '@/components/Register'
import Login from '@/components/Login'
import Index from '@/components/Index'
import CallBack from '@/components/CallBack'
import UserBind from '@/components/UserBind'
import Detail from '@/components/Detail'
import Cart from '@/components/Cart'
import OrderInfo from '@/components/OrderInfo'
import SearchDemo from '@/components/SearchDemo'
import ShowNews from '@/components/ShowNews'
import Rank from '@/components/Rank'

import QiNiuUpLoad from '@/qiniu/QiNiuUpLoad'

Vue.use(Router)

const router = new Router({
  // 路由模式
  mode: 'history',  // 去掉路由当中的#号
  routes: [
    {
      path: '/register',
      name: 'Register',
      component: Register,
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
    },
    {
      path: '/',
      name: 'Index',
      component: Index,
    },
    {
      path: '/callback',
      name: 'CallBack',
      component: CallBack,
    },
    {
      path: '/userbind',
      name: 'UserBind',
      component: UserBind,
    },
    {
      path: '/qn_upload',
      name: 'QiNiuUpLoad',
      component: QiNiuUpLoad,
    },
    {
      path: '/detail',
      name: 'Detail',
      component: Detail,
    },
    {
      path: '/cart',
      name: 'Cart',
      component: Cart,
    },
    {
      path: '/order_info',
      name: 'OrderInfo',
      component: OrderInfo,
    },
    {
      path: '/search',
      name: 'SearchDemo',
      component: SearchDemo,
    },
    {
      path: '/show_news',
      name: 'ShowNews',
      component: ShowNews,
    },
    {
      path: '/rank',
      name: 'Rank',
      component: Rank,
    }
  ]
})


export default router;